package com.zhuanzhuan.hero.user.dto.label;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @ClassName SaveUserBoundLevelLabelDTO
 * @Description
 * @Author hanjunjun
 * @Date 2024/6/19 15:36
 */
@Data
public class SaveUserBoundLevelLabelDTO {

    /**
     * 标签类型:1-经营标签,2-优势介绍
     */
    @NotBlank(message = "labelType不可为空")
    @Pattern(regexp = "^[1,2]{1}$", message = "labelType格式错误")
    private String labelType;

    /**
     * 多个一级标签
     */
    @NotEmpty
    private List<LabelInfo> labels;

    /**
     * 个人简介  最大200字
     */
    @Size(max = 200)
    private String personalDescription;

    @Data
    public static class LabelInfo {

        /**
         * 必填
         */
        private Long labelId;

        /**
         * 已绑定的标签
         */
        @Size(max = 3)
        private List<BoundLabelDTO > boundLabels;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class BoundLabelDTO {

        /**
         * 必填
         */
        private Long labelId;
    }
}
